package com.mew.game.provide;


import com.google.common.eventbus.AllowConcurrentEvents;
import com.google.common.eventbus.Subscribe;
import com.mew.common.rest.sas.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
@Slf4j
public class EventBusSubscribe {

    @Autowired
    private SasFeignService sasFeignService;

    @Subscribe
    @AllowConcurrentEvents
    private void doEnterGame(EnterGameSasRequest logoutSasRequest) {
         sasFeignService.enterGame(logoutSasRequest);
    }

    @Subscribe
    @AllowConcurrentEvents
    private void doExitGame(ExitGameSasRequest exitGameSasRequest) {
        sasFeignService.exitGame(exitGameSasRequest);
    }

    @Subscribe
    @AllowConcurrentEvents
    private void doPlayGame(PlayGameSasRequest request) {
        sasFeignService.playGame(request);
    }

}
